package com.icim.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import com.icim.entity.Bis_ope;
import com.icim.entity.Ret_prd_jge;

@Repository
public class BisOpeDao {
    @Resource
    private JdbcTemplate icimJdbcTemplate;

    public List<Bis_ope> getAllOpeInfos() {
        StringBuffer sqlBuffer = new StringBuffer("SELECT OPE_ID,OPE_VER,PEP_LVL FROM BIS_OPE ");
        return icimJdbcTemplate.query(sqlBuffer.toString(), new RowMapper<Bis_ope>() {

            @Override
            public Bis_ope mapRow(ResultSet rs, int rowNum) throws SQLException {
                Bis_ope bisOpe = new Bis_ope();
                bisOpe.setOpe_id(rs.getString("OPE_ID"));
                bisOpe.setOpe_ver(rs.getString("OPE_VER"));
                bisOpe.setPep_lvl(rs.getString("PEP_LVL"));
                return bisOpe;
            }
        });

    }
}
